package chainOfResponsibility.example;

/**
 * 总监类( 有权利审批超过2天的请假申请)
 */
public class Majordomo extends Manager {

    public Majordomo() {
    }

    public Majordomo(String name) {
        super(name);
    }

    @Override
    public void requestApplication(Request request) {
        if (request.getRequestType().equals("请假") && request.getNumber() <= 5) {
            System.out.println(request.getRequestContent() + " 数量:" + request.getNumber() + " 被批准");
        } else {
            if (superior != null) {
                superior.requestApplication(request);
            }
        }
    }
}
